package com.jumper.study.admin.dto.req;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

public class AccountReq {
    @NotBlank(message="未填写用户名", groups={AccountCreateGroup.class})
    @Size(min=4, max=12, message="用户名长度在4-12位")
    private String username;

    @NotBlank(message="未填写密码", groups={AccountCreateGroup.class})
    @Size(min=6, max=20, message="密码长度在6-20位")
    private String password;

    @NotBlank(message="未填写姓名")
    private String name;

    private String avatar;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAvatar() {
        return avatar != null ? avatar : "";
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
}
